Skip to content

Fix for Useless assignment to local variable#304

Merged
samsmithnz merged 1 commit intomainfrom
finding-autofix-70bbfa7c
Dec 5, 2025
Merged

Fix for Useless assignment to local variable#304
samsmithnz merged 1 commit intomainfrom
finding-autofix-70bbfa7c

Conversation

@samsmithnz
Copy link
Copy Markdown
Collaborator

The unnecessary assignment to the local variable result within the CountMandMsInACylinderWithNullUnitTest should be removed. Instead, simply invoke Calculator.CountMandMs(unit, height, radius); on line 332, as the test's purpose is solely to ensure that calling this method with a null unit throws (and catches) an exception. No assertion or usage of result is needed. Only the single line (332) should be changed; no variable declaration or other changes are necessary since the variable is declared and initialized in one line.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 19963984949

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 71.815%

Totals Coverage Status
Change from base Build 19962011559: 0.0%
Covered Lines: 96
Relevant Lines: 99

💛 - Coveralls

@samsmithnz samsmithnz marked this pull request as ready for review December 5, 2025 13:47
@samsmithnz samsmithnz merged commit 575c86a into main Dec 5, 2025
7 checks passed
@samsmithnz samsmithnz deleted the finding-autofix-70bbfa7c branch December 5, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants